package scsc.web.xzgl.building.businesshouse.data;

import scsc.pub.data.BusinessHouse;
import java.io.Serializable;
import scsc.pub.tools.StringUtil;
import java.math.BigDecimal;

public class BusiHouseData extends BusinessHouse implements Serializable {
	
	private String beginTime;
	private String endTime;
	private String userName;
	
	private Double transDouble(double d){ 
		BigDecimal big=new BigDecimal( d); 
		BigDecimal temp=big.setScale(2,BigDecimal.ROUND_HALF_UP); 
		return new Double(temp.doubleValue()); 
		}


	public BusiHouseData() {
		init();
	}

	public BusiHouseData(Integer roomId,String roomPlace, String room, 
			             String tenancyUnit, String corporation,
			             String identityCard, Double area, 
			             Double rentFeeStd, String rentDate,
			             String contractId, String cancelDate, 
			             String beginDate, String endDate, String tel,
			             String userId, String userName, String latestDate, 
			             String remark,String assoId) {
		this.setRoomId(roomId);
		this.setRoomPlace(StringUtil.trim(roomPlace));
		this.setRoom(StringUtil.trim(room));
		this.setTenancyUnit(StringUtil.trim(tenancyUnit));
		this.setCorporation(StringUtil.trim(corporation));
		this.setIdentityCard(StringUtil.trim(identityCard));		
		this.setArea(area!=null?transDouble(area.doubleValue()):new Double(0.00));
		this.setRentFeeStd(rentFeeStd!=null?transDouble(rentFeeStd.doubleValue()):new Double(0.00));
		this.setRentDate(StringUtil.trim(rentDate).substring(0,10));
		this.setContractId(StringUtil.trim(contractId));
		this.setCancelDate(cancelDate.substring( 0,10).equals("1900-01-01")?"":cancelDate.substring( 0,10));
		this.setBeginDate(StringUtil.trim(beginDate).substring(0,10));
		this.setEndDate(StringUtil.trim(endDate).substring(0,10));
		this.setTel(StringUtil.trim(tel));
		this.setUserId(StringUtil.trim(userId));
		this.setUserName(StringUtil.trim(userName));
		this.setLatestDate(StringUtil.trim(latestDate).substring(0,10));
		this.setRemark(StringUtil.trim(remark));
		this.setAssoId( StringUtil.trim(assoId));
	}

   public void reset() {
	   init();
   }

	public void init() {
		this.setRoomId(null);
		this.setRoomPlace("");
		this.setRoom("");
		this.setTenancyUnit("");
		this.setCorporation("");
		this.setIdentityCard("");
		this.setArea(new Double(0.0));
		this.setRentFeeStd(new Double(0.0));
		this.setRentDate("");
		this.setContractId("");
		this.setCancelDate("");
		this.setBeginDate("");
		this.setEndDate("");
		this.setTel("");
		this.setUserId("");
		this.setUserName("");
		this.setLatestDate("");
		this.setRemark("");
		
	}
	
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getBeginTime() {
		return beginTime;
	}

	public void setBeginTime(String beginTime) {
		this.beginTime = beginTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	

}
